package game.util;

public class HighscoreEntry implements Comparable<HighscoreEntry>{
   
	private String name;
	private int score;
	/**
	 * HighScoreEntry is a data structure that holds a name and a score
	 * @param name the name that the highscore entry will be under
	 * @param score the score that that person got
	 */
	public HighscoreEntry(String name, int score){
		this.name = name;
		this.score = score;
	}
	/**
	 * returns the name of the high score holder.
	 * @return the name of the high score holder.
	 */
	public String getName(){
		return name;
	}
	/**
	 * returns the score of the high score entry
	 * @return the score of the high score entry
	 */
	public int getScore(){
		return score;
	}

	@Override
	public int compareTo(HighscoreEntry e) {
		if(e.getScore() == this.score)return 0;
		else if(e.getScore() > this.score)return 1;
		else return -1;
	}
}
